package com.wyiot.pet.model.dto;

import com.wyiot.core.enums.TransportationEnum;
import com.wyiot.core.api.ValidateGroup;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;

/**
 * 用户创建订单或修改订单或者验证取件码的数据传输对象
 *
 * @author yly
 * @since 2022年03月24日
 */
@Data
public class OrderDTO {
    /**
     * 订单id
     */
    @NotNull(message = "请输入订单id", groups = {ValidateGroup.First.class , ValidateGroup.Third.class,ValidateGroup.Four.class})
    private Long orderId;
    /**
     * 订单编号
     */
    @NotBlank(message = "请输入订单号", groups = {ValidateGroup.Four.class})
    private String orderNumber;
    /**
     * 用户id
     */
    @NotNull(message = "请输入用户id", groups = {ValidateGroup.First.class,ValidateGroup.Second.class})
    private Long userId;
    /**
     * 寄件人姓名
     */
    @NotBlank(message = "请输入寄件人姓名", groups = {ValidateGroup.First.class,ValidateGroup.Second.class})
    private String userName;
    /**
     * 寄件人手机号
     */
    @NotBlank(message = "请输入寄件人手机号", groups = {ValidateGroup.First.class,ValidateGroup.Second.class})
    private String userPhone;
    /**
     * 寄件地址城市
     */
    @NotBlank(message = "请输入寄件城市", groups = {ValidateGroup.First.class,ValidateGroup.Second.class})
    private String sendAddressCity;
    /**
     * 寄件地址详情
     */
    @NotBlank(message = "请输入寄件详细地址", groups = {ValidateGroup.First.class,ValidateGroup.Second.class})
    private String sendAddressDetail;
    /**
     * 收件人姓名
     */
    @NotBlank(message = "请输入收件人姓名", groups = {ValidateGroup.First.class,ValidateGroup.Second.class})
    private String receiverName;
    /**
     * 收件人电话
     */
    @NotBlank(message = "请输入收件人联系电话", groups = {ValidateGroup.First.class,ValidateGroup.Second.class})
    private String receiverPhone;
    /**
     * 收件人地址城市
     */
    @NotBlank(message = "请输入收件人地址城市", groups = {ValidateGroup.First.class,ValidateGroup.Second.class})
    private String receiverAddressCity;
    /**
     * 收件人地址详情
     */
    @NotBlank(message = "请输入收件人详细地址", groups = {ValidateGroup.First.class,ValidateGroup.Second.class})
    private String receiverAddressDetail;
    /**
     * 上门取件时间
     */
    @NotNull(message = "请选择开始上门取件时间", groups = {ValidateGroup.First.class,ValidateGroup.Second.class})
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date orderDoorBeginTime;
    /**
     * 结束上门时间
     */
    @NotNull(message = "请选择结束上门取件时间", groups = {ValidateGroup.First.class,ValidateGroup.Second.class})
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date orderDoorEndTime;
    /**
     * 运输方式
     */
    @NotNull(message = "请选择运输方式", groups = {ValidateGroup.First.class,ValidateGroup.Second.class})
    private TransportationEnum orderTransportation;
    /**
     * 被寄的宠物
     */
    @NotEmpty(message = "请输入宠物信息" , groups = {ValidateGroup.First.class,ValidateGroup.Second.class})
    private List<PetDTO> pets;
    /**
     * 揽件员id
     */
    @NotNull(message = "请输入快递员id", groups = {ValidateGroup.Third.class})
    private Long orderTakeMan;
    /**
     *订单金额
     */
    private int orderAmount;
    /**
     * 取件码
     */
    @NotNull(message = "请输入取件码", groups = {ValidateGroup.Third.class})
    private int takeCode;

    /**
     * 物流信息(车号)
     */
    @NotBlank(message = "请填写车次", groups = {ValidateGroup.Four.class})
    private String carNumber;
    /**
     * 始发站
     */
    @NotBlank(message = "请填写始发站", groups = {ValidateGroup.Four.class})
    private String departureStation;
    /**
     * 终点站
     */
    @NotBlank(message = "请填写终点站", groups = {ValidateGroup.Four.class})
    private String destination;
    /**
     * 预计到达时间
     */
    private Date expectedDeliveryTime;

}
